import java.util.Arrays;

public class text {
    //数组逆序
    public static void Init_Order(int[] array) {
        for (int i = 0; i < array.length - 1; i++) {
            array[i] = array.length - i;
        }
    }

    public static void Insert_main(String[] args) {
        Solution solution = new Solution();

        int[] array1 = {1, 5, 8, 3, 0, 20, 75, 35, 100};
        int[] array2 = {9, 1, 2, 5, 7, 4, 8, 6, 3, 5};
        System.out.println(Arrays.toString(solution.Insert_sort(array1)));
        System.out.println(Arrays.toString(solution.Insert_sort(array2)));
    }


    public static void shell_main(String[] args) {
        Solution solution = new Solution();
        int[] array1 = {1, 5, 8, 3, 0, 20, 75, 35, 100};
        int[] array2 = {9, 1, 2, 5, 7, 4, 8, 6, 3, 5};
        System.out.println(Arrays.toString(solution.shell_sort(array1)));
        System.out.println(Arrays.toString(solution.shell_sort(array2)));
    }

    public static void select_main(String[] args) {
        Solution solution = new Solution();
        int[] array1 = {1, 5, 8, 3, 0, 20, 75, 35, 100};
        int[] array2 = {9, 1, 2, 5, 7, 4, 8, 6, 3, 5};
        System.out.println(Arrays.toString(solution.select_sort(array1)));
        System.out.println(Arrays.toString(solution.select_sort(array2)));
    }

    public static void Quick_main(String[] args) {
        Solution solution = new Solution();
        int[] array1 = {1, 5, 8, 3, 0, 20, 75, 35, 100};
        int[] array2 = {9, 1, 2, 5, 7, 4, 8, 6, 3, 5};

        solution.Quick_sort(array1);
        solution.Quick_sort(array2);

        for (int j : array1) {
            System.out.print(j + ",");
        }

        System.out.println();

        for (int i = 0; i < array2.length - 1; i++) {
            System.out.print(array2[i] + ",");
        }

//        int[] array3 = {5, 2, 3, 1, 4, 7, 6};
//        solution.Quick_sort(array3);
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] array1 = {1, 5, 8, 3, 0, 20, 75, 35, 100};
        int[] array2 = {9, 1, 2, 5, 7, 4, 8, 6, 3, 5};

        solution.Merge_sort(array1);
        solution.Merge_sort(array2);

        System.out.println(Arrays.toString(array1));
        System.out.println(Arrays.toString(array2));
    }
}
